<template>
  <page-header-wrapper>
    <a-card :bordered="false">
      <!-- 条件搜索 -->
      <div class="table-page-search-wrapper">
        <a-form layout="inline">
          <a-row :gutter="48">
            <a-col :md="8" :sm="24">
              <a-form-item label="车辆名称">
                <a-input v-model="queryParam.projectName" placeholder="请输入" allow-clear />
              </a-form-item>
            </a-col>
            <a-col :md="8" :sm="24">
              <!-- <a-form-item label="状态">
                <a-select placeholder="请选择" v-model="queryParam.status" style="width: 100%" allow-clear>
                  <a-select-option v-for="(d, index) in dict.type['sys_normal_disable']" :key="index"
                    :value="d.value">{{ d.label }}</a-select-option>
                </a-select>
              </a-form-item> -->
            </a-col>
            <a-col :md="8" :sm="24">
              <span class="table-page-search-submitButtons">
                <a-button type="primary" @click="handleQuery"><a-icon type="search" />查询</a-button>
                <a-button style="margin-left: 8px" @click="resetQuery"><a-icon type="redo" />重置</a-button>
              </span>
            </a-col>
          </a-row>
        </a-form>
      </div>
      <!-- 操作 -->
      <div class="table-operations">
        <!-- <a-button type="primary" @click="$refs.createForm.handleAdd()" v-hasPermi="['system:menu:add']">
          <a-icon type="plus" />新增
        </a-button> -->
        <table-setting :style="{ float: 'right' }" :table-size.sync="tableSize" v-model="columns"
          :refresh-loading="loading" @refresh="getList" />
      </div>
      <!-- 增加修改 -->
      <!-- <create-form ref="createForm"  :projectManagerOptions="projectManagerOptions"
        :deliverwayOptions="deliverwayOptions" @ok="getList" /> -->
      <!-- 数据展示 -->
      <a-table :loading="loading" :size="tableSize" rowKey="menuId" :columns="columns" :data-source="list"
        :pagination="false" :bordered="tableBordered">
        <span slot="icon" slot-scope="text">
          <a-icon :component="allIcon[text + 'Icon']" v-if="allIcon[text + 'Icon']" />
          <a-icon :type="text" v-if="!allIcon[text + 'Icon']" />
        </span>
        <!-- <span slot="status" slot-scope="text, record">
            <dict-tag :options="dict.type['sys_normal_disable']" :value="record.status" />
          </span> -->
        <span slot="createTime" slot-scope="text, record">
          {{ parseTime(record.createTime) }}
        </span>
        <span slot="operation" slot-scope="text, record">
          <a  v-hasPermi="['system:menu:edit']">
            <a-icon type="edit" />修改
          </a>
        </span>
      </a-table>
      <!-- 分页 -->
      <a-pagination class="ant-table-pagination" show-size-changer show-quick-jumper :current="queryParam.pageNum"
        :total="total" :page-size="queryParam.pageSize" :showTotal="total => `共 ${total} 条`"
        @showSizeChange="onShowSizeChange" @change="changeSize" />
    </a-card>
  </page-header-wrapper>
</template>

<script>

// import { listMenu, delMenu } from '@/api/system/menu'
// import CreateForm from './modules/CreateForm.vue'
import allIcon from '@/core/icons'
import { tableMixin } from '@/store/table-mixin'
import { detailsInsert, approvalFlow, listInfo } from '@/api/demo'
import baseUpload from '@/components/FileUpload'
export default {
  name: 'Menu',
  components: {
    // CreateForm,
    baseUpload
  },
  mixins: [tableMixin],
  dicts: ['sys_normal_disable', 'sys_show_hide'],
  data() {
    return {
      allIcon,
      iconVisible: false,
      list: [{name:'大货车',plate:'鲁A12345',createTime:'2024-7-20'},{name:'小货车',plate:'鲁B56822',createTime:'2024-7-20'}],
      loading: false,
      total: 0,
      openFast: false,
      queryParam: {
        projectName: undefined,
        visible: undefined,
        pageNum: 1,
        pageSize: 10,
      },
      uploadOpen: false,
      columns: [
        {
          title: '车型',
          dataIndex: 'name',
          ellipsis: true,
          width: '15%'
        },
        {
          title: '车牌号',
          dataIndex: 'plate',
          width: '15%',
          align: 'center'
        },
        {
          title: '创建时间',
          dataIndex: 'createTime',
          ellipsis: true,
          scopedSlots: { customRender: 'createTime' },
          align: 'center'
        },
        {
          title: '操作',
          dataIndex: 'operation',
          width: '20%',
          scopedSlots: { customRender: 'operation' },
          align: 'center'
        }
      ],
      projectManagerOptions: [{ value: '左洋', key: '0' },
      { value: '陈通', key: '1' },
      { value: '施梦洋', key: '2' }],
      deliverwayOptions: [{ value: '方式一', key: '0' },
      { value: '方式二', key: '1' },
      { value: '方式三', key: '2' }],
      form: {
        comments: undefined,
        imgLinks: undefined,
        infoId: undefined,
        company: '德邦物流',
        driver: '王二',
        phone: '18265624444',
        // cost: undefined,
      },
      detailsType: undefined,
      detailsId: undefined,
      remark: undefined,
    }
  },
  created() {
    this.getList()
  },
  computed: {
  },
  watch: {
  },
  methods: {
    /** 查询菜单列表 */
    getList() {
      // this.loading = true
      // listInfo(this.queryParam).then(response => {
      //   this.list = response.rows
      //   this.total = response.total
      //   this.loading = false
      // }
      // )
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.getList()
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.queryParam = {
        memuName: undefined,
        status: undefined
      }
      this.handleQuery()
    },
    onShowSizeChange(current, pageSize) {
      this.queryParam.pageSize = pageSize
      this.getList()
    },
    changeSize(current, pageSize) {
      this.queryParam.pageNum = current
      this.queryParam.pageSize = pageSize
      this.getList()
    },
    // 表单重置
    reset() {
      this.form = {
        comments: undefined,
        imgLinks: undefined,
        infoId: undefined,
        company: '德邦物流',
        driver: '王二',
        phone: '18265624444',
        // cost: undefined,
      }
      this.remark = undefined
      this.detailsId = undefined
      this.detailsType = undefined
    },
  }
}
</script>
<style lang="less">
.ant-form-item {
  margin-bottom: 10px;
}
</style>